package com.rainripple.java.starter.code.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.rainripple.java.common.dao.IDao;
import com.rainripple.java.starter.code.entity.Code;

@Service
@Transactional(readOnly = true)
public class CodeService {

	@Autowired
	private IDao dao;

	public List<Code> getAll() {
		List<Code> list =dao.selectList(Code.class);
		return list;
	}

	public Code get(Long id) {
		return dao.get(Code.class, id);
	}

	@Transactional(readOnly = false)
	public void save(Code code) {
		dao.save(code);
	}
}
